package org.linlinjava.litemall.db.domain;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class LitemallActivity {

    public enum StateEnum {
        /**
         * 状态 0-待发布 1-发布中 2-到期自动下线 3-管理手动下线
         */
        TO_BE_ISSUE((byte) 0, "待发布"),
        ISSUING((byte) 1, "发布中"),
        TIME_OUT((byte) 2, "到期自动下线"),
        STOP_FORCING((byte) 3, "管理手动下线"),;

        private Byte code;

        private String desc;

        StateEnum(Byte code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static StateEnum fromCode(Byte code) {
            return Arrays.stream(StateEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        }

        public Byte getCode() {
            return this.code;
        }

        public String getDesc() {
            return this.desc;
        }

        public static List<Byte> shallStatistics() {
            List<Byte> list = new ArrayList<>();
            list.add(LitemallActivity.StateEnum.TO_BE_ISSUE.getCode());
            list.add(LitemallActivity.StateEnum.ISSUING.getCode());
            list.add(LitemallActivity.StateEnum.STOP_FORCING.getCode());
            return list;
        }
    }

    public enum TypeEnum {
        /**
         * 活动类型 1-团购
         */
        GROUPON((byte) 1, "团购"),;

        private Byte code;

        private String desc;

        TypeEnum(Byte code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static TypeEnum fromCode(Byte code) {
            return Arrays.stream(TypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        }

        public Byte getCode() {
            return this.code;
        }

        public String getDesc() {
            return this.desc;
        }
    }

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_activity
     *
     * @mbg.generated
     */
    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_activity
     *
     * @mbg.generated
     */
    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.id
     *
     * @mbg.generated
     */
    private Integer id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.type
     *
     * @mbg.generated
     */
    private Byte type;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.title
     *
     * @mbg.generated
     */
    private String title;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.poster_title
     *
     * @mbg.generated
     */
    private String posterTitle;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.share_title
     *
     * @mbg.generated
     */
    private String shareTitle;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.start_time
     *
     * @mbg.generated
     */
    private LocalDateTime startTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.end_time
     *
     * @mbg.generated
     */
    private LocalDateTime endTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.music_url
     *
     * @mbg.generated
     */
    private String musicUrl;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.state
     *
     * @mbg.generated
     */
    private Byte state;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.add_time
     *
     * @mbg.generated
     */
    private LocalDateTime addTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.add_by
     *
     * @mbg.generated
     */
    private String addBy;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.update_time
     *
     * @mbg.generated
     */
    private LocalDateTime updateTime;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.update_by
     *
     * @mbg.generated
     */
    private String updateBy;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column litemall_activity.deleted
     *
     * @mbg.generated
     */
    private Boolean deleted;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.id
     *
     * @return the value of litemall_activity.id
     * @mbg.generated
     */
    public Integer getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.id
     *
     * @param id the value for litemall_activity.id
     * @mbg.generated
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.type
     *
     * @return the value of litemall_activity.type
     * @mbg.generated
     */
    public Byte getType() {
        return type;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.type
     *
     * @param type the value for litemall_activity.type
     * @mbg.generated
     */
    public void setType(Byte type) {
        this.type = type;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.title
     *
     * @return the value of litemall_activity.title
     * @mbg.generated
     */
    public String getTitle() {
        return title;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.title
     *
     * @param title the value for litemall_activity.title
     * @mbg.generated
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.poster_title
     *
     * @return the value of litemall_activity.poster_title
     * @mbg.generated
     */
    public String getPosterTitle() {
        return posterTitle;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.poster_title
     *
     * @param posterTitle the value for litemall_activity.poster_title
     * @mbg.generated
     */
    public void setPosterTitle(String posterTitle) {
        this.posterTitle = posterTitle;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.share_title
     *
     * @return the value of litemall_activity.share_title
     * @mbg.generated
     */
    public String getShareTitle() {
        return shareTitle;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.share_title
     *
     * @param shareTitle the value for litemall_activity.share_title
     * @mbg.generated
     */
    public void setShareTitle(String shareTitle) {
        this.shareTitle = shareTitle;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.start_time
     *
     * @return the value of litemall_activity.start_time
     * @mbg.generated
     */
    public LocalDateTime getStartTime() {
        return startTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.start_time
     *
     * @param startTime the value for litemall_activity.start_time
     * @mbg.generated
     */
    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.end_time
     *
     * @return the value of litemall_activity.end_time
     * @mbg.generated
     */
    public LocalDateTime getEndTime() {
        return endTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.end_time
     *
     * @param endTime the value for litemall_activity.end_time
     * @mbg.generated
     */
    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.music_url
     *
     * @return the value of litemall_activity.music_url
     * @mbg.generated
     */
    public String getMusicUrl() {
        return musicUrl;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.music_url
     *
     * @param musicUrl the value for litemall_activity.music_url
     * @mbg.generated
     */
    public void setMusicUrl(String musicUrl) {
        this.musicUrl = musicUrl;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.state
     *
     * @return the value of litemall_activity.state
     * @mbg.generated
     */
    public Byte getState() {
        return state;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.state
     *
     * @param state the value for litemall_activity.state
     * @mbg.generated
     */
    public void setState(Byte state) {
        this.state = state;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.add_time
     *
     * @return the value of litemall_activity.add_time
     * @mbg.generated
     */
    public LocalDateTime getAddTime() {
        return addTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.add_time
     *
     * @param addTime the value for litemall_activity.add_time
     * @mbg.generated
     */
    public void setAddTime(LocalDateTime addTime) {
        this.addTime = addTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.add_by
     *
     * @return the value of litemall_activity.add_by
     * @mbg.generated
     */
    public String getAddBy() {
        return addBy;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.add_by
     *
     * @param addBy the value for litemall_activity.add_by
     * @mbg.generated
     */
    public void setAddBy(String addBy) {
        this.addBy = addBy;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.update_time
     *
     * @return the value of litemall_activity.update_time
     * @mbg.generated
     */
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.update_time
     *
     * @param updateTime the value for litemall_activity.update_time
     * @mbg.generated
     */
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.update_by
     *
     * @return the value of litemall_activity.update_by
     * @mbg.generated
     */
    public String getUpdateBy() {
        return updateBy;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.update_by
     *
     * @param updateBy the value for litemall_activity.update_by
     * @mbg.generated
     */
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table litemall_activity
     *
     * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_activity.deleted
     *
     * @return the value of litemall_activity.deleted
     * @mbg.generated
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_activity.deleted
     *
     * @param deleted the value for litemall_activity.deleted
     * @mbg.generated
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table litemall_activity
     *
     * @mbg.generated
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", IS_DELETED=").append(IS_DELETED);
        sb.append(", NOT_DELETED=").append(NOT_DELETED);
        sb.append(", id=").append(id);
        sb.append(", type=").append(type);
        sb.append(", title=").append(title);
        sb.append(", posterTitle=").append(posterTitle);
        sb.append(", shareTitle=").append(shareTitle);
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", musicUrl=").append(musicUrl);
        sb.append(", state=").append(state);
        sb.append(", addTime=").append(addTime);
        sb.append(", addBy=").append(addBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", deleted=").append(deleted);
        sb.append("]");
        return sb.toString();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table litemall_activity
     *
     * @mbg.generated
     */
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        LitemallActivity other = (LitemallActivity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
                && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
                && (this.getPosterTitle() == null ? other.getPosterTitle() == null : this.getPosterTitle().equals(other.getPosterTitle()))
                && (this.getShareTitle() == null ? other.getShareTitle() == null : this.getShareTitle().equals(other.getShareTitle()))
                && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
                && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
                && (this.getMusicUrl() == null ? other.getMusicUrl() == null : this.getMusicUrl().equals(other.getMusicUrl()))
                && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
                && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
                && (this.getAddBy() == null ? other.getAddBy() == null : this.getAddBy().equals(other.getAddBy()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
                && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
                && (this.getDeleted() == null ? other.getDeleted() == null : this.getDeleted().equals(other.getDeleted()));
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table litemall_activity
     *
     * @mbg.generated
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getPosterTitle() == null) ? 0 : getPosterTitle().hashCode());
        result = prime * result + ((getShareTitle() == null) ? 0 : getShareTitle().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getMusicUrl() == null) ? 0 : getMusicUrl().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
        result = prime * result + ((getAddBy() == null) ? 0 : getAddBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getDeleted() == null) ? 0 : getDeleted().hashCode());
        return result;
    }

    /**
     * This enum was generated by MyBatis Generator.
     * This enum corresponds to the database table litemall_activity
     *
     * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        private final Boolean value;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        private final String name;

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public Boolean getValue() {
            return this.value;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public Boolean value() {
            return this.value;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String getName() {
            return this.name;
        }
    }

    /**
     * This enum was generated by MyBatis Generator.
     * This enum corresponds to the database table litemall_activity
     *
     * @mbg.generated
     */
    public enum Column {
        id("id", "id", "INTEGER", false),
        type("type", "type", "TINYINT", true),
        title("title", "title", "VARCHAR", false),
        posterTitle("poster_title", "posterTitle", "VARCHAR", false),
        shareTitle("share_title", "shareTitle", "VARCHAR", false),
        startTime("start_time", "startTime", "TIMESTAMP", false),
        endTime("end_time", "endTime", "TIMESTAMP", false),
        musicUrl("music_url", "musicUrl", "VARCHAR", false),
        state("state", "state", "TINYINT", true),
        addTime("add_time", "addTime", "TIMESTAMP", false),
        addBy("add_by", "addBy", "VARCHAR", false),
        updateTime("update_time", "updateTime", "TIMESTAMP", false),
        updateBy("update_by", "updateBy", "VARCHAR", false),
        deleted("deleted", "deleted", "BIT", false);

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        private static final String BEGINNING_DELIMITER = "`";

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        private static final String ENDING_DELIMITER = "`";

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        private final String column;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        private final boolean isColumnNameDelimited;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        private final String javaProperty;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        private final String jdbcType;

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String value() {
            return this.column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String getValue() {
            return this.column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String getJavaProperty() {
            return this.javaProperty;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String getJdbcType() {
            return this.jdbcType;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public static Column[] excludes(Column... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_activity
         *
         * @mbg.generated
         */
        public String getAliasedEscapedColumnName() {
            return this.getEscapedColumnName();
        }
    }
}